import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
export const swaggerPath = 'doc';

export const swaggerConfig = new DocumentBuilder()
  .setTitle('NestJS 演示')
  .setDescription('API 说明')
  .setVersion('1.0')
  .addTag('demo')
  .build();

export default function swaggerInit(app: any) {
  const document = SwaggerModule.createDocument(app, swaggerConfig);
  SwaggerModule.setup(swaggerPath, app, document);
}
